package com.xyht.sca_s.student_manage_system.modules.card.controller;


import com.xyht.sca_s.student_manage_system.common.commonReturn.ResponseResult;
import com.xyht.sca_s.student_manage_system.common.desEncodeAndDecode.annotation.SecretBody;
import com.xyht.sca_s.student_manage_system.modules.card.entity.SmsCardProcess;
import com.xyht.sca_s.student_manage_system.modules.card.entity.req.SmsCardProcessReq;
import com.xyht.sca_s.student_manage_system.modules.card.service.SmsCardProcessService;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 证件补办流程设置 前端控制器
 * </p>
 *
 * @author XYHT
 * @since 2023-01-20
 */
@RestController
@RequestMapping("/card/process")
@SecretBody
public class SmsCardProcessController {
    @Autowired
    private SmsCardProcessService smsCardProcessService;

    //创建一种审核流程
    @PostMapping("/add")
    public ResponseResult addLeaveProcess(@RequestBody SmsCardProcessReq smsCardProcessReq) {
        return smsCardProcessService.addCardProcess(smsCardProcessReq);
    }

    //删除一种审核流程
    @ApiModelProperty(value = "删除请假流程")
    @PostMapping("/delete")
    public ResponseResult deleteCardProcess(@RequestBody SmsCardProcess smsCardProcess) {
        return smsCardProcessService.deleteCardProcess(smsCardProcess);
    }

    //获取审核流程列表
    @ApiModelProperty(value = "获取证件补办流程列表")
    @GetMapping("/list")
    public ResponseResult getCardProcess(@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
        return smsCardProcessService.getCardProcess(pageSize, pageNum);
    }

    //根据审核流程id 获取对应的审核环节
    @ApiModelProperty(value = "获取证件补办流程对应环节")
    @GetMapping("/detail")
    public ResponseResult getCardProcessDetail(@RequestParam("process_id") String process_id) {
        return smsCardProcessService.getCardProcessDetail(process_id);
    }
    //根据审核流程id 获取对应的审核环节具体进度

}

